/* $Id: TextAreaEditor.java 136 2011-08-28 13:31:15Z altdotua@gmail.com $ */

package alt.djudge.frontend.client.ui.editors;

import com.google.gwt.user.client.ui.TextArea;


public class TextAreaEditor extends TextArea implements CustomEditor
{
	@Override
	public String getValueForKey(String key)
	{
		int len = key.length();
		if (len <= 30)
			return key;
		return key.substring(0, 30) + "...";
	}
	
	@Override
	public String getValue()
	{
		return super.getText();
	}

	@Override
	public String getKey()
	{
		return getText();
	}

	@Override
	public void setKey(String key)
	{
		setText(key);
	}

	@Override
	public void setValue(String value)
	{
		setText(value);
	}
}
